# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=dqlite
pkgver=1.16.0
pkgrel=0
pkgdesc="Embeddable, replicated and fault tolerant SQL engine"
url="https://dqlite.io/"
arch="all"
license="LGPL-3.0"
depends="raft"
makedepends="libuv-dev sqlite-dev raft-dev autoconf automake libtool"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/canonical/dqlite/archive/v$pkgver.tar.gz
	no-werror.patch
	"

prepare() {
	default_prepare
	autoreconf -i
}

build() {
	./configure  \
		--prefix=/usr
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/dqlite/LICENSE
}

sha512sums="
f9bc7ea3021d72bd81fe487d1c11b86a566002e2b1ddf6000b0fd54e407746ac35af079afc508d9d752de774dfee33c5c6e54c40c7884ac67a3bc7dca14ea362  dqlite-1.16.0.tar.gz
3979f6476d819d67007381d1b3c29c1444973f9dc17e2d637eeb455404c1a1039f4191cf8a844639fb61aee2e3d0661b9c8b70383790920d79c14cf3482eec67  no-werror.patch
"
